/**
 * 圆形ICon
 * chentao 2018.1.5
 * @flow
 */
import React, { PureComponent } from 'react';
import {
    View,
    Image,
} from 'react-native';

class CircleIcon extends PureComponent {
    render(){
        let {iconH,icon,bgColor='#eee'} = this.props;
        let gen2 = 1.41422;
        let diffR = 0.41422;
        return(
            <View style={{width:iconH * gen2,height:iconH * gen2,alignItems:'center',justifyContent:'center',backgroundColor:'transparent'}}>
                <Image source={icon} style={{width:iconH,height:iconH}}/>
                <View style={{position:'absolute',top:0,right:0,width:iconH * gen2,height:iconH * gen2,
                    backgroundColor:'transparent',borderColor:bgColor,borderWidth:diffR * iconH / 2,borderRadius:iconH * gen2 / 2}}
                />
            </View>
        );
    }
}

export default CircleIcon;
